<template>
	<div>
		<el-form :model="form.addParamInfo">
			
			<el-form-item label="名称" :label-width="formLabelWidth" >
		      <el-input v-model="form.addParamInfo.name"></el-input>
		    </el-form-item>

		    <el-form-item label="参数" :label-width="formLabelWidth">
		      <el-input v-model="form.addParamInfo.param"></el-input>
		    </el-form-item>

		    <el-form-item label="文本类型" :label-width="formLabelWidth">
		    	<el-select v-model="form.addParamInfo.type" placeholder="请选择">
				    <el-option key="text"  value="text">
				    	<span style="float: left">文本</span>
				    	<span style="float: right; color: #8492a6; font-size: 13px">text</span>
				    </el-option>
				    <el-option key="radio"  value="radio">
				    	<span style="float: left">单选</span>
				    	<span style="float: right; color: #8492a6; font-size: 13px">radio</span>
				    </el-option>
				    <el-option key="checkbox"  value="checkbox">
				    	<span style="float: left">多选</span>
				    	<span style="float: right; color: #8492a6; font-size: 13px">checkbox</span>
				    </el-option>
				    <el-option key="select"  value="select">
				    	<span style="float: left">下拉框</span>
				    	<span style="float: right; color: #8492a6; font-size: 13px">select</span>
				    </el-option>
					<el-option key="file"  value="file">
				    	<span style="float: left">文件</span>
				    	<span style="float: right; color: #8492a6; font-size: 13px">file</span>
				    </el-option>
				    <el-option key="image"  value="image">
				    	<span style="float: left">图片</span>
				    	<span style="float: right; color: #8492a6; font-size: 13px">image</span>
				    </el-option>
				    <el-option key="textarea"  value="textarea">
				    	<span style="float: left">文本域</span>
				    	<span style="float: right; color: #8492a6; font-size: 13px">textarea</span>
				    </el-option>

				  </el-select>
		    </el-form-item>

		    <el-form-item label="备注说明"  :label-width="formLabelWidth">
		      	<el-input v-model="form.addParamInfo.mark"></el-input>
		    </el-form-item>
		</el-form>
		<div class="dialog-footer">
			<span slot="footer">
			    <el-button @click="closeDialog">取 消</el-button>
			    <el-button type="primary" @click="dialogOkBtn">确 定</el-button>
			</span>
		</div>
	  
	</div>
</template>

<script>

import _http from '../common/http.vue'
export default{
	data(){
		return{
			form:{
				addParamInfo:{
					name:'',
					param:'',
					mark:'',
					type:'',
				}
			},
			formLabelWidth:'120px'
		}
	},
	methods:{
		closeDialog(){
			this.$emit('closeDialog')
		},
		dialogOkBtn(){
    		_http.axiosRequest(this,'configAddParam',{form:this.form.addParamInfo},(res)=>{
    			if (_http.apiResult(this,res.data)) {
    				this.closeDialog()
    				this.$emit('freshList')
    			}
    		})
		}
	}
}
</script>
<style>
	.dialog-footer{
		text-align: right
	}
</style>